package com.zw.knowlege.controller;

import com.alibaba.fastjson.JSONObject;
import com.zw.common.annotation.InterfaceAttribute;
import com.zw.common.constant.InterfaceNameConstants;
import com.zw.common.response.ResponseResult;
import com.zw.knowlege.annotation.ParamCheckJson;
import com.zw.knowlege.common.StaticValue;
import com.zw.knowlege.service.CollectRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @Author xtyu
 * @Date 2022/5/11
 * @description 收藏记录处理的Controller
 */
@RestController
@RequestMapping("/collectrecord")
public class CollectRecordController {

    @Autowired
    private CollectRecordService collectRecordService;

    @PostMapping("/collectProcess")
    @InterfaceAttribute(name = InterfaceNameConstants.KNOWLEGE_EXPERIENCE_MYCOLLECT, operateType = "4", module = "7")
    @ParamCheckJson(args={StaticValue.EXPERIENCE_ID, StaticValue.EXPERIENCE_USERINFO_USERID, StaticValue.EXPERIENCE_ACTION, StaticValue.RECORDTYPE})
    public ResponseResult myCollectRecord(@RequestBody JSONObject paramJson){
        return collectRecordService.doCollectProcess(paramJson);
    }
}
